import React, { Component } from 'react'

import DividerItem from '@/components/DividerItem';
import ListCard from '@/components/ListCard';
import { DATA_INFO } from '../enum';

interface P {
  data: { [x: string]: any };
}

interface S {

}

class Details extends Component<P, S> {

  render() {
    const { data } = this.props;

    const info = DATA_INFO.map((item, index) => {
      return {
        name: `${item.name}：`,
        value: data[item.key]
      }
    });

    const Info = DividerItem({
      WrapperComponent: () => <ListCard data={info} type="small" step={2} />,
      icon: 'file-text', title: '详细信息', type: 'small', bordered: true
    });

    return (
      <div style={{ width: '100%', height: '100%' }}>
        <Info />
      </div>
    )
  }
}

export default Details;